package com.example.demo.service;

import com.example.demo.entity.Visitor;
import com.example.demo.mapper.VisitorMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VisitorService {
    @Autowired
    private VisitorMapper visitorMapper;

    public List<Visitor> getVisitorList(){
        return visitorMapper.getVisitorAll();
    }
    public Visitor getVisitorById(int id){
        return visitorMapper.getVisitorById(id);
    }
    public void addVisitor(Visitor visitor){
        visitorMapper.insertVisitor(visitor);
    }
}
